(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.limit.limitTreeController', limitController);
	limitController.$inject = ['$scope', 'limitService'];
	function limitController($scope, limitService) {
		var ctrl = this, log = $scope.loggerFactory.getLogger("limitTree");
		ctrl.limitTreeApi = {};
		ctrl.limitData = [];
		ctrl.limitSelected = function(limit) {
			if (limit.type == 'NODE') {
				$scope.go('cda.limit.limitTree.list', limit);
			}
		};
		
		
		limitService.getCategoryTree().then(function(response){
			ctrl.limitData = response.data || [];
		});
		
	};
})(angular);